package com.itheima.d11_observer2;

import java.util.Observable;
import java.util.Observer;

/**
 * 具体的观察者
 */
public class Person implements Observer /*jdk提供的观察者接口*/ {

    private String name;
    private int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public void update(Observable o, Object price) {
        System.out.println(name+"，您关注的房源价格有更新，最新价格为："+price);
    }
}
